/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CareerService.Entitybeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "notice")
@NamedQueries({@NamedQuery(name = "Notice.findAll", query = "SELECT n FROM Notice n"), @NamedQuery(name = "Notice.findByNoticeId", query = "SELECT n FROM Notice n WHERE n.noticeId = :noticeId"), @NamedQuery(name = "Notice.findByClassification", query = "SELECT n FROM Notice n WHERE n.classification = :classification"), @NamedQuery(name = "Notice.findByReaded", query = "SELECT n FROM Notice n WHERE n.readed = :readed")})
public class Notice implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "notice_id")
    private Integer noticeId;
    @Column(name = "classification")
    private Short classification;
    @Lob
    @Column(name = "content")
    private String content;
    @Basic(optional = false)
    @Column(name = "readed")
    private short readed;
    @JoinColumn(name = "receiver_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private Users receiverId;
    @JoinColumn(name = "sender_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private Users senderId;

    public Notice() {
    }

    public Notice(Integer noticeId) {
        this.noticeId = noticeId;
    }

    public Notice(Integer noticeId, short readed) {
        this.noticeId = noticeId;
        this.readed = readed;
    }

    public Integer getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(Integer noticeId) {
        this.noticeId = noticeId;
    }

    public Short getClassification() {
        return classification;
    }

    public void setClassification(Short classification) {
        this.classification = classification;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public short getReaded() {
        return readed;
    }

    public void setReaded(short readed) {
        this.readed = readed;
    }

    public Users getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(Users receiverId) {
        this.receiverId = receiverId;
    }

    public Users getSenderId() {
        return senderId;
    }

    public void setSenderId(Users senderId) {
        this.senderId = senderId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (noticeId != null ? noticeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Notice)) {
            return false;
        }
        Notice other = (Notice) object;
        if ((this.noticeId == null && other.noticeId != null) || (this.noticeId != null && !this.noticeId.equals(other.noticeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "CareerService.Entitybeans.Notice[noticeId=" + noticeId + "]";
    }

}
